package demo;

import java.util.Collection;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;



@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring/spring-config.xml")
public class DemoTest {
	
	private Log logger = LogFactory.getLog(getClass());
	
	@Autowired
	private SomeService service;
	
	
	
	@Test
	public void testFindUser() {
		User findUser = service.findUser();
		logger.info(findUser);
		
	}

	@Test
	public void testFindAllUsers() {
		Collection<User> findAllUsers = service.findAllUsers();
		for (User user : findAllUsers) {
			logger.info(user);
		}
	}

	@Test
	public void testAddUser() {
		User user = new User();
		service.addUser(user);
		
	}

}
